package com.heaven.controller;

import com.heaven.pojo.Result;
import com.heaven.pojo.User;
import com.heaven.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@CrossOrigin(origins="http://localhost:7000")
@RequestMapping("/register")
public class RegisterController {
    @Autowired
    private UserService userService;

    @PostMapping
    public Result add_re(@RequestBody User user){
        log.info("新注册成员:{}",user);
        userService.add__re(user);
        return Result.success();
    }

}
